package by.zmy.aop;

import java.lang.reflect.Method;

// 切面接口
public interface Aspect {
    // 前置通知
    default void before(Object target, Method method, Object[] args) {
    }

    // 后置通知
    default void after(Object target, Method method, Object[] args, Object result) {
    }

    // 环绕通知
    default Object around(Object target, Method method, Object[] args, MethodInvocation invocation) throws Throwable {
        return invocation.proceed();
    }

    // 异常通知
    default void afterThrowing(Object target, Method method, Object[] args, Throwable throwable) {
    }
}

